<template>
<div>
  <h1>干</h1>
  <p><input type="text" v-model="username"></p>
  <button @click="login">确定授权</button>
</div>
</template>

<script>
export default {
  name: "sanfang",
  data(){
  return{
    username:'',
    uid:'123',
    token:'zxcvbn',
  }
  },
  methods:{
  login(){
  this.$axios.get('/login/login?uid='+this.uid+'&token='+this.token+'&username='+this.username)
  .then(res=>{
  if (res.data.code==200){
  alert('登录成功')
  localStorage.setItem('userid',res.data.userid)
  localStorage.setItem('username',res.data.username)
  window.location.href = res.data.url
  }
  })

  }
  }
}
</script>

<style scoped>

</style>
